//
//  DateUtils.m
//  TourDeGarde
//
//  Created by Edenyorke on 14/12/11.
//  Copyright (c) 2011 Edenyorke. All rights reserved.
//

#import "DateUtils.h"

@implementation DateUtils

@synthesize df;

- (NSDate* )getDateFromString:(NSString *)dateString {

    return [df dateFromString:dateString];
    
}

- (NSString* )getStringFromDate:(NSDate *)date {
    
    if (date == nil){
        return @"";
    }
    
    return [df stringFromDate:date];
}

-(id)initWithHours{
    
    df= [[NSDateFormatter alloc] init];
    [df setLocale:[NSLocale currentLocale]];
    [df setDateFormat:NSLocalizedString(@"DateFormatWithHours", @"")];

    return self;
}

-(id)init{
    
    df= [[NSDateFormatter alloc] init];
    [df setLocale:[NSLocale currentLocale]];
    [df setDateFormat:NSLocalizedString(@"DateFormat", @"")];
    
    return self;
}

@end
